import type { RouteRecordRaw } from 'vue-router'
// 定义动态路由
export const allAsyncRoutes: Array<RouteRecordRaw> = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/index.vue'),
    meta: {
      title: '首页',
      icon: 'HomeFilled',
      isAffix: "true",
      activeMenu: '/',
    }
  },
  // 大屏展示
  {
    path: '/dataScreen/Info',
    name: 'DataScreenInfo',
    component: () => import('@/views/dataScreen/index.vue'),
    meta: {
      title: '数据大屏',
      icon: "Histogram",
      isFull:true,
      activeMenu: '/dataScreen',
    },
  },
  // 菜单嵌套管理
  {
    path: "/menu",
    name: "Menu",
    redirect: '/menu/menuBase',
    // 父级的meta是否有效取决于子菜单是否存在且存在的个数：当子菜单只有一个的时候，那么父级将不会显示，默认显示是唯一的一个子菜单
    // 如果有多个 children ，那么父级将会显示，且点击父级会显示和隐藏所有子菜单项
    meta: {
      title: "菜单嵌套",
      icon: "Menu",
    },
    children: [
      {
        path: '/menu/menuBase',
        name: 'MenuBase',
        component: () => import('@/views/menu/menuBase/index.vue'),
        meta: {
          title: '基础菜单',
          icon: "Menu"
        },
      },
      {
        path: '/menu/menuNested',
        name: 'MenuNested',
        redirect: '/menu/menuNested/menu1/menu11',
        meta: {
          title: '嵌套菜单',
          icon: "Menu"
        },
        children: [
          {
            path: '/menu/menuNested/menu1',
            name: 'Menu1',
            redirect: '/menu/menuNested/menu1/menu11',
            meta: {
              title: '子菜单1',
            },
            children: [
              {
                path: '/menu/menuNested/menu1/menu11',
                name: 'Menu11',
                component: () => import('@/views/menu/menuNested/menu1/menu11/index.vue'),
                meta: {
                  title: '子菜单11',
                },
              },
              {
                path: '/menu/menuNested/menu1/menu12',
                name: 'Menu12',
                component: () => import('@/views/menu/menuNested/menu1/menu12/index.vue'),
                meta: {
                  title: '子菜单12',
                },
              },
            ]

          },
          {
            path: '/menu/menuNested/menu2',
            name: 'Menu2',
            component: () => import('@/views/menu/menuNested/menu2/index.vue'),
            meta: {
              title: '子菜单2',
            },
          },
        ]
      },
    ]

  },
  // 权限管理
  {
    path: "/auth",
    name: "Auth",
    redirect: '/auth/authMenu',
    meta: {
      title: "权限管理",
      icon: "Avatar",
    },
    children: [
      {
        path: '/auth/authMenu',
        name: 'AuthMenu',
        component: () => import('@/views/auth/authMenu/index.vue'),
        meta: {
          title: '菜单权限',
        },
      },
      {
        path: '/auth/authButton',
        name: 'AuthButton',
        component: () => import('@/views/auth/authButton/index.vue'),
        meta: {
          title: '按钮权限',
        },
      },
    ]
  },
  //自定义指令
  {
    path: '/directives/info',
    name: 'DirectivesInfo',
    component: () => import('@/views/directives/index.vue'),
    meta: {
      title: '自定义指令',
      icon: 'Stamp',
      activeMenu: '/directives'
    },
  },
  // 自定义组件
  {
    path: "/customComponents",
    name: "CustomComponents",
    redirect: '/customComponents/uploader"',
    meta: {
      title: "自定义组件",
      icon: "MessageBox",
    },
    children: [
      {
        path: "/customComponents/uploader",
        name: "CustomUploader",
        component: () => import('@/views/customComponents/uploader/index.vue'),
        meta: {
          title: '文件上传',
          icon: "Menu",
        },
      },
      {
        path: "/customComponents/grid",
        name: "CustomGrid",
        component: () => import('@/views/customComponents/grid/index.vue'),
        meta: {
          title: 'Grid布局',
          icon: "Menu",
        },
      },
      {
        path: "/customComponents/searchForm",
        name: "CustomSearchForm",
        component: () => import('@/views/customComponents/searchForm/index.vue'),
        meta: {
          title: 'Form组件',
          icon: "Menu",
        },
      },
      {
        path: "/customComponents/treeFilter",
        name: "CustomTreeFilter",
        component: () => import('@/views/customComponents/treeFilter/index.vue'),
        meta: {
          title: '树形筛选器',
          icon: "Menu",
        },
      },
      {
        path: "/customComponents/draggable",
        name: "Draggable",
        component: () => import('@/views/customComponents/draggable/index.vue'),
        meta: {
          title: 'Drag组件',
          icon: "Menu",
        },
      },
      {
        path: '/customComponents/svgIcon',
        name: 'SvgIcon',
        component: () => import('@/views/customComponents/svgIcon/index.vue'),
        meta: {
          title: 'SVG 图片',
          icon: "Menu"
        },
      },
      {
        path: '/customComponents/tabOperation',
        name: 'TabOperation',
        component: () => import('@/views/customComponents/tabOperation/index.vue'),
        meta: {
          title: '标签页操作',
          icon: "Menu"
        },
      },
      {
        path: '/customComponents/tabOperation/detail/:id',
        name: 'TabDetail',
        component: () => import('@/views/customComponents/tabOperation/detail.vue'),
        meta: {
          title: '标签页详情',
          isHide: true,
          icon: "Menu"
        },
      },
      {
        path: '/customComponents/classifyFilter',
        name: 'ClassifyFilter',
        component: () => import('@/views/customComponents/classifyFilter/index.vue'),
        meta: {
          title: '分类筛选器',
          icon: "Menu"
        },
      },
      {
        path: '/customComponents/iconSelector',
        name: 'IconSelector',
        component: () => import('@/views/customComponents/iconSelector/index.vue'),
        meta: {
          title: '图标选择器',
          icon: "Menu"
        },
      },
      {
        path: '/customComponents/wangEditor',
        name: 'WangEditor',
        component: () => import('@/views/customComponents/wangEditor/index.vue'),
        meta: {
          title: '富文本编辑器',
          icon: "Menu"
        },
      },

    ]
  },
  // 组件用例
  {
    path: '/useComponents',
    name: 'UseComponents',
    redirect: '/useComponents/dataVisualize',
    meta: {
      title: '组件用例',
      icon: 'Briefcase',
    },
    children: [
      {
        path: "/useComponents/dataVisualize",
        name: "DataVisualize",
        component: () => import('@/views/useComponents/dataVisualize/index.vue'),
        meta: {
          title: '数据可视化',
          icon: "Menu",
        },
      },
      {
        path: "/useComponents/proTable/useProTable",
        name: "UseProTable",
        component: () => import('@/views/useComponents/proTable/useProTable/index.vue'),
        meta: {
          title: 'UseProTable',
          icon: "Menu",
        },
      },
    ]
  },
  //echarts
  {
    path: '/echarts',
    name: 'Echarts',
    redirect: "/echarts/dynamic",
    meta: {
      title: 'echarts',
      icon: 'TrendCharts',
    },
    children: [
      {
        path: '/echarts/dynamic',
        name: 'Dynamic',
        component: () => import('@/views/echarts/dynamic/index.vue'),
        meta: {
          title: '动态折线图',
        },
      },
      {
        path: '/echarts/radarChart',
        name: 'RadarChart',
        component: () => import('@/views/echarts/radarChart/index.vue'),
        meta: {
          title: '雷达图',
        },
      },
      {
        path: '/echarts/waterChart',
        name: 'WaterChart',
        component: () => import('@/views/echarts/waterChart/index.vue'),
        meta: {
          title: '水波图',
        },
      },
    ]
  },
  // 外部链接
  {
    path: '/externalLink',
    name: 'ExternalLink',
    redirect: '/externalLink/embeddedWeb',
    component: () => import("@/layout/index.vue"),
    meta: {
      title: '外部链接',
      icon: 'Link',
    },
    children: [
      {
        path: '/externalLink/embeddedWeb',
        name: 'EmbeddedWeb',
        component: () => import('@/views/embedded/embeddedWeb/index.vue'),
        meta: {
          title: '内嵌网页',
          icon: 'Menu',
          activeMenu: '/embedded/embeddedWeb'
        },

      },
      {
        path: '/externalLink/giteeLink',
        name: 'GiteeLink',
        component: () => import('@/views/link/index.vue'),
        meta: {
          title: 'gitee',
          icon: 'Menu',
          isLink: "https://gitee.com/HalseySpicy/Geeker-Admin",
          activeMenu: '/about'
        },
      },
    ]
  },
  //关于
  {
    path: '/about/index',
    name: 'AboutInfo',
    component: () => import('@/views/about/index.vue'),
    meta: {
      title: '关于',
      icon: 'InfoFilled',
      activeMenu: '/about'
    },
  },
]